<template>
	<view>
		
		<view>
			<view class="content">
				<view>
					<text class="title">{{res.title}}</text>
				</view>
				<view>
					<text>{{res.create_time}}</text>
				</view>
				<view style="margin-top: 70upx;">
					<image class="pic" :src="'https://cx.mingmeijt.com' + res.image_detail" mode="widthFix"></image>
					<!-- <view class="cover">
						活动结束
					</view> -->
				</view>
				<text class="introduce">{{res.content}}</text>
				<!-- <view class="bot b-t" @click="todetail(item.id)">
					<text>查看详情</text>
					<text class="more-icon yticon icon-you"></text>
				</view> -->
			</view>
		</view>
			
	</view>
</template>

<script>
	export default {
		data() {
			return {
				res:[],
				user_id:'',
				id:'',
			}
		},
		onLoad:function(e){
			this.id = e.id
			uni.showLoading()
			uni.getStorage({
				key: 'user_id',
				success: (res) => {
					this.user_id = res.data
					this.setAjax()
				}
			});
		},
		methods: {
			setAjax(){
				uni.request({
					url: 'https://cx.mingmeijt.com/Api/News/detail',
					method: 'POST',
					data:{
						news_id: this.id,
						user_id: this.user_id,
						session_id: uni.getStorageSync("sessionid")
					},
					header:{'Content-Type':'application/x-www-form-urlencoded'},
					success: res => {
						if(res.data.code == 999){
							uni.navigateTo({
								url:'/pages/999/999'
							})
						};
						if(res.data.code == 998){
							uni.navigateTo({
								url:'/pages/login/login'
							})
						}
						uni.hideLoading()
						this.res = res.data.data
						console.log(this.res)
					},
					fail: () => {},
					complete: () => {}
				});
				
			},
		}
	}
</script>

<style lang='scss'>
	page {
		background-color: #f7f7f7;
		padding-bottom: 30upx;
	}
	.active {
		 border-bottom: 5upx solid #000;
		 color: #000;
		 }
	.notice-item {
		display: flex;
		flex-direction: column;
		align-items: center;
	}

	.time {
		display: flex;
		align-items: center;
		justify-content: center;
		height: 80upx;
		padding-top: 10upx;
		font-size: 26upx;
		color: #7d7d7d;
	}

	.content {
		width: 100%;
		/* width: 710upx; */
		padding: 0 24upx;
		background-color: #fff;
		border-radius: 4upx;
	}

	.title {
		display: flex;
		align-items: center;
		height: 90upx;
		font-size: 34upx;
		color: #000;
		font-weight: 555;
	}

	.img-wrapper {
		width: 100%;
		height: 260upx;
		position: relative;
	}

	.pic {
		display: block;
		width: 100%;
		height: 100%;
		border-radius: 6upx;
	}

	.cover {
		display: flex;
		justify-content: center;
		align-items: center;
		position: absolute;
		left: 0;
		top: 0;
		width: 100%;
		height: 100%;
		background-color: rgba(0, 0, 0, .5);
		font-size: 36upx;
		color: #fff;
	}

	.introduce {
		display: inline-block;
		padding: 16upx 0;
		font-size: 28upx;
		color: #606266;
		line-height: 38upx;
	}

	.bot {
		display: flex;
		align-items: center;
		justify-content: space-between;
		height: 80upx;
		font-size: 24upx;
		color: #707070;
		position: relative;
	}

	.more-icon {
		font-size: 32upx;
	}
</style>

